<include file="Public/header" />
<title>管理员列表</title>
</head>
<body>
<div class="pd-20" style="margin-top:-20px;">
	<div class="cl pd-5 bg-1 bk-gray mt-20"> 
		<form class="formleft" name="" id="" action="__URL__/order/" method="get">
			<input class="input-text" style="width:200px" type="text" value="<{$_GET['goods_no']}>" placeholder="商品编号" name="goods_no">
			<input class="input-text" style="width:200px" type="text" value="<{$_GET['goods_name']}>" placeholder="商品名称" name="goods_name">
			<button type="submit" class="btn btn-success"><i class="icon-plus"></i> 查询</button>
			<a href="javascript:;" onclick="admin_open('添加','__URL__/add_orderdetail/order_id/<{:I('id')}>',0,'800','480')" class="btn btn-primary radius"><i class="Hui-iconfont"></i> 添加</a>
		</form>
		<span class="r">共有数据：<strong><{$count}></strong> 条</span> 
    </div>
	<table class="table table-border table-bordered table-bg">
		<thead>
			<tr>
				<th scope="col" colspan="15">订单信息</th>
			</tr>
			<tr class="text-c">
				<th width="">收件人姓名</th>
				<th width="">运单号</th>
				<th width="">发件人姓名</th>
				<th width="">发件人电话</th>
				<th width="">发件人地址</th>
				<th width="">标记</th>
				<th width="">付费状态</th>
				<th width="">订单类型</th>
				<th width="">备注1</th>
				<th width="">备注2</th>
			</tr>
		</thead>
		<tbody>
			<tr class="text-c">
				<td><{$detail.user_name}></td>
				<td>
					<a href="javascript:;" style="color:blue;" onclick="admin_open('快递状态','__ROOT__/ems/index/mail_no/<{$detail.logistics_no}>','<{$detail.logistics_no}>','800','480')" >
						<{$detail.logistics_no}>
					</a>
				</td>
				<td><{$detail.sendman}></td>
				<td><{$detail.user_phone}></td>
				<td><{$detail.province}><{$detail.city}><{$detail.area}><{$detail.user_address}></td>
				<td>
				<if condition="$detail.flag eq 1">
					<img src="__PUBLIC__/img/flag/flag_green.png">
				</if>
				<if condition="$detail.flag eq 2">
					<img src="__PUBLIC__/img/flag/flag_yellow.png">
				</if>
				<if condition="$detail.flag eq 3">
					<img src="__PUBLIC__/img/flag/flag_red.png">
				</if>
				</td>
				<td>
				<if condition="$detail.pay_status eq 1">
					已付款
				</if>
				<if condition="$detail.pay_status eq 2">
					<span style="color:red">未付款</span>
				</if>
				<if condition="$detail.pay_status eq 0">
					未设置
				</if>
				</td>
				<td>
				<if condition="$detail.order_cate2 eq 1">
					<span style="color:blue">现货</span>
				</if>
				<if condition="$detail.order_cate2 eq 2">
					<span style="color:red">直邮</span>
				</if>
				<if condition="$detail.order_cate2 eq 3">
					<span style="color:yellow">保税</span>
				</if>
				</td>
				<td>
					<{$detail.mark1}>
				</td>
				<td>
					<{$detail.mark2}>
				</td>
			</tr>		
		</tbody>
	</table>
	<br>
	<table class="table table-border table-bordered table-bg">
		<thead>
			<tr>
				<th scope="col" colspan="15">商品列表</th>
			</tr>
			<tr class="text-c">
				<th>序号</th>
				<th width="">商品编号</th>
				<th width="">商品名称</th>
				<th width="">数量</th>
				<th width="">单价</th>
				<th width="">品牌</th>
				<th width="">型号</th>
				<th width="">规格</th>
				<th width="">缩略图</th>
				<th width="">净重(g)</th>
				<th width="">毛重(g)</th>
				<th width="">操作</th>
			</tr>
		</thead>
		<tbody>
			<volist name="list" id="vo">
			<tr class="text-c">
				<td><{$i}></td>
				<td><{$vo.goods_no}></td>
				<td><{$vo.goods_name}></td>
				<td><{$vo.goods_nums}></td>
				<td><{$vo.goods_price}></td>
				<td><{$vo.goods_brand}></td>
				<td><{$vo.goods_marque}></td>
				<td><{$vo.goods_spec}></td>
				<td>
					<img src="<{:get_pic($vo['goods_pic'])}>" style="width:50px" />
				</td>
				<td><{:sprintf("%.2f",$vo['net_weight'])}></td>
				<td><{:sprintf("%.2f",$vo['gross_weight'])}></td>
				<td>
				<empty name="vo.goods_nums">
					<a href="javascript:;" onclick="edit_orderdetail(<{$vo.id}>)" class="">编辑</a>
				</empty>
				
				<a title="删除" href="javascript:;" onclick="admin_del('__URL__/del_orderdetail/','<{$vo.id}>')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont"></i></a>
				</td>
			</tr>
			</volist>			
		</tbody>
	</table>
	<div class="page mt" style="text-align:right"><{$page}></div>
</div>
<script type="text/javascript" src="__PUBLIC__/js/jquery.form.js"></script>
<script>
	function edit_orderdetail(id){
		layer.prompt({title:'请输入数量',formType:0},function(text,index){
			if(isNaN(text)){
				layer.msg('操作有误');
				return false;
			}
			$.post('__MODULE__/Order/edit_orderdetail',{
				id:id,
				count:text,
			},function (msg){
				layer.msg(msg.message);
				if(msg.status==1){
					setTimeout(function (){
						location.reload();
					},800);
				}
			},'json');
		});
	}
	//推送
	function push(){
		var option = $(".ids");
		var checked_counts=0;
		var check_val = [];
        for(var i=0;i<option.length;i++){
			if(option[i].checked){
				checked_counts++;
				check_val.push(option[i].value);
			}
		}
		if(checked_counts==0){
			layer.msg('请选择内容');
			return false;
		}else{
			$.ajax({
				type: 'POST',
				data: {ids:check_val},
				url: "<{:U('pushoms')}>",
				success:function(data){
					if(data.status==1){	//检查通过，跳转生成波次单页面
						layer.msg(data.message,function(){
							window.location.reload();
						});
					}else{			//检查未通过，刷新页面
						layer.msg(data.message);
					}
					return false;
				}
			})
		}
	}
	function importexcelAll(id){
        var index=layer.open({
            type: 2,
            title: '导入数据',
            shadeClose: true,
            shade: 0.5,
            area: ['1000px', '150px'],
            content: '__MODULE__/import/importPushorder/'+Math.random() //iframe的url
        });
    }
	function exportExcel(){
		var url="<{:U('Order/order',array('excel'=>1))}>/?1=1";
		logistics_no=$('input[name=logistics_no]').val();
		order_no=$('input[name=order_no]').val();
		user_name=$('input[name=user_name]').val();
		user_idcard=$('input[name=user_idcard]').val();
		user_phone=$('input[name=user_phone]').val();
		user_address=$('input[name=user_address]').val();
		
		pay_status=$('select[name=pay_status]').val();
		goods_name=$('input[name=goods_name]').val();
		sendMan=$('input[name=sendMan]').val();
		
		start_time=$('input[name=start_time]').val();
		end_time=$('input[name=end_time]').val();
		
		if(pay_status!=0){
			url=url+"&pay_status="+pay_status;
		}
		if(goods_name!=""){
			url=url+"&goods_name="+goods_name;
		}
		if(sendMan!=""){
			url=url+"&sendMan="+sendMan;
		}
		
		if(logistics_no!=""){
			url=url+"&logistics_no="+logistics_no;
		}
		if(order_no!=""){
			url=url+"&order_no="+order_no;
		}
		if(user_name!=""){
			url=url+"&user_name="+user_name;
		}
		if(user_idcard!=""){
			url=url+"&user_idcard="+user_idcard;
		}
		if(user_phone!=""){
			url=url+"&user_phone="+user_phone;
		}
		if(user_address!=""){
			url=url+"&user_address="+user_address;
		}
		if(start_time!=""){
			url=url+"&start_time="+start_time;
		}
		if(end_time!=""){
			url=url+"&end_time="+end_time;
		}
		window.location.href=url;
	}

</script>
 <include file="Public/footer" />
<include file="Public/footer_js" />
</body>
</html>